import request from '@/utils/request'

// 获取部门列表
export function getDepartmentsApi() {
  return request({
    url: '/company/department'
  })
}

// 删除部门列表
export function delDepartmentsApi(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

// 获取部门负责人列表
export const getUserSimpleListApi = () => {
  return request({
    url: '/sys/user/simple'
  })
}
// 添加部门列表所需参数

export const addDepartmentApi = (form) => {
  return request({
    url: '/company/department',
    data: form,
    method: 'post'
  })
}
// 获取部门详情
export const getDepartmentDataiApi = id => {
  return request({
    url: `/company/department/${id}`
  })
}

export const editDepartmentApi = (form) => {
  return request({
    url: `/company/department/${form.id}`,
    method: 'put',
    data: form
  })
}
